﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DispatchAssist.BusinessLogical.Model
{
    public class Alert
    {

        /// <summary>
        /// Alert 构造函数
        /// </summary>
        public Alert()
        { }


        /// <summary>
        /// Alert OR映射构造函数
        /// </summary>
        public Alert(System.Data.IDataReader dr)
        {
            this.AlertID = (Guid)dr["AlertID"];
            this.MetroMsgID = (Guid)dr["MetroMsgID"];
            this.FlightInfoID = Convert.ToString(dr["FlightInfoID"]);
            this.AirportRelation = Convert.ToString(dr["AirportRelation"]);
            this.AlertTime = Convert.ToDateTime(dr["AlertTime"]);
            this.AlertActionFlag = Convert.ToInt32(dr["AlertActionFlag"]);
            this.PerformActionFlag = Convert.ToInt32(dr["PerformActionFlag"]);
            this.SeatID = (Guid)dr["SeatID"];
            this.LastModifyTime = Convert.ToDateTime(dr["LastModifyTime"]);
            this.DeleteFlag = Convert.ToBoolean(dr["DeleteFlag"]);
        }


        /// <summary>
        /// 唯一标识
        /// </summary>
        public Guid AlertID { get; set; }

        /// <summary>
        /// 对应的气象预警报文唯一标识
        /// </summary>
        public Guid MetroMsgID { get; set; }

        /// <summary>
        /// 对应的航班动态唯一标识
        /// </summary>
        public string FlightInfoID { get; set; }

        /// <summary>
        /// 告警机场关系，如：计划降落场、起飞备降场
        /// </summary>
        public string AirportRelation { get; set; }

        /// <summary>
        /// 预警时间
        /// </summary>
        public DateTime AlertTime { get; set; }

        /// <summary>
        /// 告警行为位叠加
        /// </summary>
        public int AlertActionFlag { get; set; }

        /// <summary>
        /// 已执行告警行为位叠加
        /// </summary>
        public int PerformActionFlag { get; set; }

        /// <summary>
        /// 告警席位ID
        /// </summary>
        public Guid SeatID { get; set; }

        /// <summary>
        /// 最后修改时间
        /// </summary>
        public DateTime LastModifyTime { get; set; }

        /// <summary>
        /// 逻辑删除标记
        /// </summary>
        public bool DeleteFlag { get; set; }

        public override string ToString()
        {
            return string.Format("[告警信息标识:{0}]", AlertID.ToString());
        }

    }
}
